Skip to content

Update ESLint to v9 and TypeScript to latest#5739

Merged
lkostrowski merged 35 commits intomainfrom
update-eslint-flatconfig
Aug 6, 2025
Merged

Update ESLint to v9 and TypeScript to latest#5739
lkostrowski merged 35 commits intomainfrom
update-eslint-flatconfig

Conversation

@witoszekdev
Copy link
Member

@witoszekdev witoszekdev commented Jul 23, 2025

This PR migrates Dashboard to use ESLint v9 which uses flat config and fixes reported errors after that migration (that's the cause of large file count change). It also updates TypeScript to latest version - this had to be done to resolve issues with TypeScript ESLint plugin.

Most of changes in files are stylistic or to fix TypeScript errors and don't impact any logic. For logic changes there were comments from me (see below).

Note

For some reason depcruise detected a change in:

>   info Macaw UI - migration: testUtils/themeWrapper.tsx → node_modules/@saleor/macaw-ui/dist/cjs/index.js

Which is incorrect, this file was not changed. That's why macaw migration check is failing

Note

There are more warnings now due to recommended changes in Code Review. All of existing warnings still exists (checked using diff), due to plugin updates there were also new error messages added in the same files or some were changed.

It also fixes some other setup related issues that become apparent after this migration:

  • TypeScript version is now pinned (previously we used ^).
  • Removed prettier ESLint plugin and config - we don't need it, since prettier is running separately and no rules are causing conflicts
  • Removed unused dependencies
  • Codegen files no longer add /* eslint-disable */ comment, since they were removed from ESLint checks by using global config
  • Fixed a bug in redirects that got discovered due to TypeScript error after update

@changeset-bot
Copy link

changeset-bot bot commented Jul 23, 2025

🦋 Changeset detected

Latest commit: 6849202

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
saleor-dashboard Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jul 23, 2025

Differences Found

⚠️ 135 packages or licenses were added.

Expand
License	Package
Apache-2.0	@eslint/config-array
Apache-2.0	@eslint/config-helpers
Apache-2.0	@eslint/core
Apache-2.0	@eslint/object-schema
Apache-2.0	@eslint/plugin-kit
Apache-2.0	@humanfs/core
Apache-2.0	@humanfs/node
Apache-2.0	@humanwhocodes/retry
Apache-2.0	@pollyjs/adapter
Apache-2.0	@pollyjs/core
Apache-2.0	@pollyjs/persister
Apache-2.0	@pollyjs/utils
Apache-2.0	web-vitals
BSD-3-Clause	@sentry/cli-win32-arm64
ISC	walk-up-path
MIT	@babel/helper-globals
MIT	@babel/plugin-syntax-class-static-block
MIT	@babel/plugin-syntax-import-attributes
MIT	@babel/plugin-syntax-private-property-in-object
MIT	@codexteam/icons
MIT	@editorjs/dom
MIT	@editorjs/helpers
MIT	@emnapi/core
MIT	@emnapi/runtime
MIT	@emnapi/wasi-threads
MIT	@esbuild/openharmony-arm64
MIT	@jest/pattern
MIT	@napi-rs/wasm-runtime
MIT	@oxc-resolver/binding-android-arm-eabi
MIT	@oxc-resolver/binding-android-arm64
MIT	@oxc-resolver/binding-darwin-arm64
MIT	@oxc-resolver/binding-darwin-x64
MIT	@oxc-resolver/binding-freebsd-x64
MIT	@oxc-resolver/binding-linux-arm-gnueabihf
MIT	@oxc-resolver/binding-linux-arm-musleabihf
MIT	@oxc-resolver/binding-linux-arm64-gnu
MIT	@oxc-resolver/binding-linux-arm64-musl
MIT	@oxc-resolver/binding-linux-ppc64-gnu
MIT	@oxc-resolver/binding-linux-riscv64-gnu
MIT	@oxc-resolver/binding-linux-riscv64-musl
MIT	@oxc-resolver/binding-linux-s390x-gnu
MIT	@oxc-resolver/binding-linux-x64-gnu
MIT	@oxc-resolver/binding-linux-x64-musl
MIT	@oxc-resolver/binding-wasm32-wasi
MIT	@oxc-resolver/binding-win32-arm64-msvc
MIT	@oxc-resolver/binding-win32-ia32-msvc
MIT	@oxc-resolver/binding-win32-x64-msvc
MIT	@radix-ui/react-use-effect-event
MIT	@rolldown/pluginutils
MIT	@rollup/rollup-linux-ppc64-gnu
MIT	@rollup/rollup-linux-riscv64-musl
MIT	@rtsao/scc
MIT	@sindresorhus/fnv1a
MIT	@tybys/wasm-util
MIT	@types/codemirror
MIT	@types/set-cookie-parser
MIT	@types/tern
MIT	@typescript-eslint/parser
MIT	@typescript-eslint/project-service
MIT	@typescript-eslint/tsconfig-utils
MIT	@typescript-eslint/typescript-estree
MIT	@wry/caches
MIT	array-buffer-byte-length
MIT	array.prototype.findlast
MIT	array.prototype.findlastindex
MIT	arraybuffer.prototype.slice
MIT	async-function
MIT	blueimp-md5
MIT	bowser
MIT	call-bind-apply-helpers
MIT	call-bound
MIT	data-view-buffer
MIT	data-view-byte-length
MIT	data-view-byte-offset
MIT	debounce-promise
MIT	define-data-property
MIT	dunder-proto
MIT	emoji-regex-xs
MIT	es-define-property
MIT	es-errors
MIT	es-iterator-helpers
MIT	es-object-atoms
MIT	es-set-tostringtag
MIT	fd-package-json
MIT	formatly
MIT	get-proto
MIT	globalthis
MIT	gopd
MIT	has-proto
MIT	hasown
MIT	is-absolute-url
MIT	is-array-buffer
MIT	is-async-function
MIT	is-data-view
MIT	is-finalizationregistry
MIT	is-generator-function
MIT	iterator.prototype
MIT	json-buffer
MIT	keyv
MIT	loglevel
MIT	math-intrinsics
MIT	napi-postinstall
MIT	object.groupby
MIT	own-keys
MIT	oxc-resolver
MIT	possible-typed-array-names
MIT	quansync
MIT	reflect.getprototypeof
MIT	rehackt
MIT	route-recognizer
MIT	safe-array-concat
MIT	safe-push-apply
MIT	set-cookie-parser
MIT	set-function-length
MIT	set-function-name
MIT	set-proto
MIT	side-channel-list
MIT	side-channel-map
MIT	side-channel-weakmap
MIT	stop-iteration-iterator
MIT	string.prototype.repeat
MIT	string.prototype.trim
MIT	supports-preserve-symlinks-flag
MIT	ts-api-utils
MIT	typed-array-buffer
MIT	typed-array-byte-length
MIT	typed-array-byte-offset
MIT	typed-array-length
MIT	typescript-eslint
MIT	undici-types
MIT	utf8-byte-length
MIT	which-builtin-type
SEE LICENSE IN LICENSE	posthog-js
SEE LICENSE IN LICENSE	spawndamnit
WTFPL	utf8-byte-length

Summary

Expand
License Name Package Count Packages
0BSD 1
Packages
  • tslib
CC0-1.0 1
Packages
  • type-fest
MIT/X11 1
Packages
  • nub
MPL-1.1 1
Packages
  • harmony-reflect
MPL-2.0 1
Packages
  • dompurify
Public Domain 1
Packages
  • jsonify
Python-2.0 1
Packages
  • argparse
CC-BY-4.0 2
Packages
  • @saleor/macaw-ui
  • caniuse-lite
SEE LICENSE IN LICENSE 2
Packages
  • posthog-js
  • spawndamnit
WTFPL 2
Packages
  • opener
  • utf8-byte-length
<<missing>> 3
Packages
  • busboy
  • saleor-dashboard
  • streamsearch
BlueOak-1.0.0 3
Packages
  • jackspeak
  • package-json-from-dist
  • path-scurry
BSD-2-Clause 22
Packages
  • browser-process-hrtime
  • css-select
  • css-what
  • domelementtype
  • domhandler
  • domutils
  • dotenv
  • dotenv-expand
  • entities
  • escodegen
  • eslint-scope
  • espree
  • esprima
  • esrecurse
  • estraverse
  • esutils
  • nth-check
  • stringify-object
  • terser
  • uglify-js
  • And 2 more...
BSD-3-Clause 46
Packages
  • @saleor/app-sdk
  • @sentry/cli
  • @sentry/cli-darwin
  • @sentry/cli-linux-arm
  • @sentry/cli-linux-arm64
  • @sentry/cli-linux-i686
  • @sentry/cli-linux-x64
  • @sentry/cli-win32-arm64
  • @sentry/cli-win32-i686
  • @sentry/cli-win32-x64
  • @sinonjs/commons
  • @sinonjs/fake-timers
  • abab
  • asn1js
  • babel-plugin-istanbul
  • charenc
  • chroma-js
  • crypt
  • diff
  • esquery
  • And 26 more...
ISC 51
Packages
  • @isaacs/cliui
  • @istanbuljs/load-nyc-config
  • anymatch
  • boolbase
  • browser-stdout
  • cli-width
  • cliui
  • electron-to-chromium
  • fastq
  • flatted
  • foreground-child
  • fs.realpath
  • get-caller-file
  • get-own-enumerable-property-symbols
  • glob
  • glob-parent
  • graceful-fs
  • inflight
  • inherits
  • ini
  • And 31 more...
Apache-2.0 55
Packages
  • @ampproject/remapping
  • @editorjs/editorjs
  • @eslint/config-array
  • @eslint/config-helpers
  • @eslint/core
  • @eslint/object-schema
  • @eslint/plugin-kit
  • @humanfs/core
  • @humanfs/node
  • @humanwhocodes/module-importer
  • @humanwhocodes/retry
  • @opentelemetry/api
  • @opentelemetry/semantic-conventions
  • @playwright/test
  • @pollyjs/adapter
  • @pollyjs/core
  • @pollyjs/persister
  • @pollyjs/utils
  • @swc/core
  • @swc/core-darwin-arm64
  • And 35 more...
MIT 1267
Packages
  • @adobe/css-tools
  • @apollo/client
  • @ardatan/relay-compiler
  • @ardatan/sync-fetch
  • @babel/code-frame
  • @babel/compat-data
  • @babel/core
  • @babel/generator
  • @babel/helper-annotate-as-pure
  • @babel/helper-compilation-targets
  • @babel/helper-create-class-features-plugin
  • @babel/helper-globals
  • @babel/helper-member-expression-to-functions
  • @babel/helper-module-imports
  • @babel/helper-module-transforms
  • @babel/helper-optimise-call-expression
  • @babel/helper-plugin-utils
  • @babel/helper-replace-supers
  • @babel/helper-skip-transparent-expression-wrappers
  • @babel/helper-string-parser
  • And 1247 more...

@github-actions github-actions bot temporarily deployed to pr-5739 July 23, 2025 15:03 Destroyed
- Auto-fixed import sorting across all files
- Fixed formatting issues automatically corrected by ESLint
- Includes initial TypeScript error fixes in test files
- Fix unreachable nullish coalescing operators in OrderPayment component
- Fix unnecessary filter in OrderTransaction CardTitle component
- Fix nullish coalescing in PermissionGroupDetailsPage and StaffList filters
- Fix optional maxDecimalLength usage in PriceField component
- All TypeScript checks now passing for both src and playwright
- Install eslint-import-resolver-typescript to resolve module resolution issues
- Configure import resolver settings for both TypeScript and Node.js
- Re-enable import/no-duplicates rule
- Document Storybook plugin as disabled (no Storybook files in project)
- Import plugin now working correctly with ESLint 9 flat config
@vercel
Copy link

vercel bot commented Jul 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
saleor-dashboard-storybook ⬜️ Ignored (Inspect) Visit Preview Aug 6, 2025 0:15am

@codecov
Copy link

codecov bot commented Jul 30, 2025

Codecov Report

❌ Patch coverage is 55.88235% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.38%. Comparing base (b475d26) to head (9bb7e58).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...rc/orders/components/OrderPayment/OrderPayment.tsx 54.54% 4 Missing and 1 partial ⚠️
src/components/RichTextEditor/ReactEditorJS.tsx 0.00% 2 Missing ⚠️
...rderTransaction/components/CardTitle/CardTitle.tsx 0.00% 2 Missing ⚠️
src/components/Attributes/utils.ts 0.00% 1 Missing ⚠️
...c/components/Datagrid/customCells/DropdownCell.tsx 0.00% 1 Missing ⚠️
...omponents/Datagrid/customCells/Money/MoneyCell.tsx 0.00% 1 Missing ⚠️
src/components/ExternalLink/ExternalLink.tsx 50.00% 1 Missing ⚠️
src/components/PriceField/usePriceField.ts 83.33% 1 Missing ⚠️
...roducts/components/ProductListDatagrid/datagrid.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5739      +/-   ##
==========================================
- Coverage   66.40%   66.38%   -0.02%     
==========================================
  Files        1458     1456       -2     
  Lines       25399    25403       +4     
  Branches     5195     5224      +29     
==========================================
- Hits        16865    16864       -1     
+ Misses       8488     7969     -519     
- Partials       46      570     +524     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

witoszekdev and others added 4 commits July 31, 2025 13:53
Resolved merge conflicts and integrated latest changes from main branch:
- Removed old .eslintrc.json that came back from main
- Fixed nullish coalescing in useEnrichConditions.ts
- Updated PermissionGroupDetailsPage.tsx with correct hasAllChannels logic
- Regenerated package-lock.json to resolve dependency conflicts
- Fixed critical ESLint errors (unused expressions in playwright and AppWidgets)
- Added ESLint rule overrides for legacy code compatibility

All merge conflicts resolved, ESLint configuration updated for compatibility.
- Removed invalid @typescript-eslint/key-spacing eslint-disable comment
- Converted require() imports to ES modules in test file
- Fixed duplicate Jest mocks declarations
- Updated import resolver to use only TypeScript resolver
- Installed missing resolve dependency

ESLint now runs clean with 0 errors, only warnings remain.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot temporarily deployed to pr-5739 July 31, 2025 14:03 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5739 July 31, 2025 15:04 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5739 July 31, 2025 16:17 Destroyed
@witoszekdev witoszekdev force-pushed the update-eslint-flatconfig branch from 6ff16e1 to e64892e Compare August 5, 2025 13:19
@github-actions github-actions bot temporarily deployed to pr-5739 August 5, 2025 13:23 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5739 August 5, 2025 13:29 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5739 August 5, 2025 16:05 Destroyed
@witoszekdev witoszekdev requested a review from lkostrowski August 5, 2025 16:10
@witoszekdev
Copy link
Member Author

@lkostrowski I've checked rules again and there in fact were some of them missing either due to my mistake or because I used different set of recommended rules 😅

@github-actions github-actions bot temporarily deployed to pr-5739 August 5, 2025 16:15 Destroyed
kzuraw
kzuraw previously approved these changes Aug 6, 2025
lkostrowski
lkostrowski previously approved these changes Aug 6, 2025
kzuraw and others added 4 commits August 6, 2025 14:08
* Update MacawUI to 1.3.0

* use 1.3.1
* refactor: improve UnderlineLink component API and structure

- Extract UnderlineText component for better separation of concerns
- Change UnderlineLink to extend anchor attributes instead of TextProps
- Add textProps parameter for customizing text styling
- Set default size={2} in UnderlineText component
- Remove redundant size props from component usage

* fixes after cr
@witoszekdev witoszekdev dismissed stale reviews from lkostrowski and kzuraw via 6849202 August 6, 2025 12:08
@lkostrowski lkostrowski merged commit 6637b0b into main Aug 6, 2025
21 of 24 checks passed
@lkostrowski lkostrowski deleted the update-eslint-flatconfig branch August 6, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants